package DBHelper;

import exceptions.ObjectNotFoundException;
import java.math.BigInteger;
import java.sql.SQLException;

public class MutableObject extends Object {

    public MutableObject(BigInteger id) throws SQLException, ObjectNotFoundException {
        super(id);
    }
    public void setName(String name) throws SQLException {
        String query = "update objects set name = "+name+" where object_id = "+this.getId();
        DBHelper.executeQuery(query);
    }
    public void setParentId(BigInteger parentId) throws SQLException {
        String query = "update objects set parent_id = "+parentId+" where object_id = "+this.getId();
        DBHelper.executeQuery(query);
    }
    public void setDescription(String descr) throws SQLException {
        String query = "update objects set description = "+descr+" where object_id = "+this.getId();
        DBHelper.executeQuery(query);
    }
}
